add initContext helper to set fields we expect to be present