Implemented some kind of reducer to UI