Refactored things a bit in reset