cli class refactor