Moved the Schema Discovery code to its own SchemaDiscoveryHelper class.