refactoring the user module