refactored signal and added small test case