Refactor the user module