Refactoring: separating DB read and write impls to keep class sizes down