unsignificant refactoring in signal handlers