refactor to fix array store problem with generic SliceArray