Revert "Reduced the number of local variables"

This reverts commit b82c7dd343d43db7b200814657bfc5677afed392.