Improved whitespace removal