fixed issue #21: removed State machine reference from core (+ a bit of refactoring of the run method)