Reorganized filterMessage() for proper reading
Added test input
Prevented creation of useless threads