remove trailing spaces
remove unnecessary strings