minirefactor, formalized signal handler