Split service and plugin code