users module refactoring