wrapped transition by order functionality into a function so we can return or throw on trouble and let the rest of the code go on