refactoring UserManager, improving file diff