Shorten code by using temp variables, cleanup variable names.
Merge pull request #364 from Dmitry-Me/tempVariablesAndBetterNames

Shorten code by using temp variables, cleanup variable names.