Stop using global definition of with_stimulus
Some cleanup