move business logic to models