Moved parser code to ui.js