Refactoring: introduce DBCollection interface and its in-memory implementation