Cleanup code a little bit, nicer design, fixed cancel handling
Merge pull request #1 from BenoitZugmeyer/master

Cleanup code a little bit, nicer design, fixed cancel handling