remove the unneeded spaces.