refactor; type->typespec, Array -> Indexed