#51 more DB refactoring