Transfer some functions to model from controller