refactor; and add completexContext/failedContext/ContextMessage handlers

final