Moved repository layer for documents to a higher level