refactoring of mechanism of user management