refactor db schema