Moved persistence code from controllers to service