Creating separate classes for metadatas and collection.
Create entity persisters.
Create a unit of work.