Cleanup and reordering