Refactoring example code for the dialog helper command test