Database code cleanup.