trip extraneous whitespace and extra hyphens