added repository with reusable query logic