rewrite UI.js