Refactor initialize/reset, add logic to reset

Moved the expressions for initialize to the reset method and added logic
that calls reset recursively if a different name isn't created.