refactor all UI specific code into separate files