refactor user profile code into composed class