Feature/whitespace filter fix

Fixed whitespace filter not working correctly, and cleaned the class up

Fixes #10