Sort control file by reference