refactor array shape