More UI decoupling, refactoring