improved code for Transition.isAvailable method