move db related code to its own package