Refactor code to preserve local variables to a class method.
Preserve local variables between spec runs.