refactor; and add completexContext/failedContext/ContextMessage handlers