#5 - db refactoring.