Split cli specific bits into a package and tidy up modules