* split functions in sub parts to ease future testing * save run fewer times * rework events logic to considere both run phase and result changes (emit an event on every phase or result change)