Remove findDefinition and add config option to register the doctrine listener.