fixes for CLI and general cleanup of code-style and findings
general cleanup/fix of findings