user management refactoring