Move model to service and fix example