remove trailing whitespace & small code layout fixes