Refactoring + quick connection between refactored backend and ui triggers to make it work again