Converting to jQuery Widget format