remove unwanted if conditions
remove trailing spaces