Split transition matrix calculation to separate module