Refactoring GenericRepository