splitting scui.js code