Reworked database structure