Reworked table generation