Reworked self_transition to be more efficient