refactor user account managing