Fix getuser and refactor user module