I'm not in love with this how this behavior can change so much based on, among other things, global state. I guess it's needed though?