update_profile method
refactored