Improves cli output presentation logic
Rewrites cli return logic to have one single exit point
Fixes cli function import