Cli class improvement

See CRM-13050