refact schema