Finished the DB refactor.