Moved ui and input code into separate files.