Refactor user profile edit