separate and cleanup db classes