Reworked database tables