master cmd refactoring