major changes to DB structure, need refactoring