refactor db schemas out of code