refactor example
refactor with co-thread