ensure commandt is installed
refactor conditional