Refactor ArrayObject to improve performance