refact db schema