Moved the service to a separate file