Refactor DB models