Refactoring

- functions moved to classes
- old UI render functions removed