Move do_when_ready to end of the file

To address #110