cleanup and reorder