Moved into one file. Separated database and ui functionality into separate classes.