reset button, minor refactorings