cleanups of signalhanlder code (esp safe signal hanlders - a little more efficient)