Refactored users controller