minor refactoring
fixed memory consumption problem with shutdown handler
Merge pull request #20 from zelgerj/master

fixed memory consumption problem with shutdown handler