Refactoring the repository structure