completed refactor and switched to one database