refactored transition object out of state.ts