NewArray refactored