This conversion from the imt to a tuple of values is performed several times in the same fashion. Could you factor out these lines of code in a separate function/method and update event_based.core_next as well?