strip excessive whitespaces/newlines