This is normal bookkeeping code and thus should be kept away from code that has to do with simulation.