Reducing complexity of the resetAll function.