started database refactor