Major reworking of CLI