refactored out common code from L3/L4 interpreters.