Some code-style, code-quality and comments improvements

Hi, I’m just studying your code and considering to extend it for me needs. As a “side effect” of this I’ve did some cosmetic improvements for better readability and clarity. So there it is, if you like it, you can merge it. :)