Reorganize db helpers