cleaned up database structure