refactor jqueryui