move signal handler registration to main file