Added UIHandler, and refactored code in Interpreter