cosmetic: tabs -> spaces / strip trailing spaces

code has a mix of tabs / spaces indentation and trailing spaces/tabs - here is a cleanup.