moved descriptor code around