Refactored repository structure