Refactored way transitions are generated and UI is built