Refactor users controller