Reorganize example code