util database code cleanup