Revert "Code refactor. Corrected variable declarations."

This reverts commit 64c75990b595b198a9422e3a4caa7725116456bf.