Refactoring SQLite DB modules