this method is not needed here the widget factory basically does this already https://github.com/jquery/jquery-ui/blob/master/ui/jquery.ui.widget.js#L335