Cleanup and improvement of YUI behaviour.