Modify DocumentRepository move out partly logic in private methods. Separate interface and implementation. Add method findDocuments by query and profile.