Added db reset feature and minor refactoring of methods