controller_user tests and refactor