Implemented the new database layout