Refactored db schema