refactor users controller