refactor; and add completexContext/failedContext/ContextMessage handlers

I think you can use `failedContext.getParentContext().orElse(null)`