refactor; and add completexContext/failedContext/ContextMessage handlers

use proper Java formatting here and below