Refactor. Add DBHandler. Test.