user_data, db: improve how returned user data is handled