improve parsing of tables into arrays