Refactor vectorize code generation for array object