database refactor complete.