DSL for disposable state machines