add cli version, code cleanups and cosmetic changes