move business logic to model