Refactor translateSignal for more flexible signal handling.