Refactor transitions