re-arrange transition and test functions