refactored parts of op_new_array and op_new_pattern into _new_element