strip unneeded whitespace from the data