Refactor array test