legacy service context casting