Some refactoring and more to make cmd
Some more checks to make