db class code cleanup