minor refactor for array support codes