Refactor DB