refactored how EventStore uses Repository<T>