Misc clean enh

Misc clean and little enh. or fixes.

please keep 2 lines between function/method, it's easier to read with 2 lines.