simplified and optimized dedSecondLayerVariableUnification