refactor filter_table_by_elements
#701
+52
−66
Draft