Move user count logic to controller