moved user methods from controller to user