much more integrated code; begin of consolidation into $L namespace