big code cleanup

( code style, indent, trailling whitespace, doc comments, doc comments indent)