implemented some database utilities