Move ui.js out