Refactor table make_list function