Reformat widget order code