Database code reorganized.