Change resetInternalState to be more flexible for different tools