OK, so I think you should add method to sm, that calls handling dialogs + sm.main_dialog and return boolean. So your client need not handle dialog creation.