Moving domain logic from controller to model.