Replace handle_line with signal