tie generated tables to functions they are used in