push controller code down to model