MID-1939 implementation - not yet finished.