Update to work with new database structure.