CLI code cleanup