Reorganise to make cmd code more prominant