Reindent and remove trailing whitespaces