Revert "replace instance variables with local variables"

This reverts commit 2f19f046913d0ec234a6cc5e5a387eec9c700c0c.