Reorder and cleanup.