added repository indirection to facilitate testing.