backported --touch-reload refactoring from 1.5
backported master+emperor fix from 1.5