added InMemory version for testing