Reorder some demos code.