Move methods from controller to models