Clean up whitespace handler logic