Reduse code duplication in dialogs' client side templates