Refactor array concatenation