Refactored users controller and stats logic.