remove excess spaces and commas