reorder and clean the targets