refactor table_for code to make overriding specliazied methods easier