More refactoring. Predatabase work.