minor refactorings
new signal detection mechanism