Also separate the logic for exiting the loop based on coreState. IO and audio won't necessarily be tied to the frame.