Issue #97 - Make it possible to use blocks for handling state changes.