refactor user controller a bit to be more readable