migrate code to use YUI