fixed and cleaned up user profile implementation