Use temp variables to simplify code.
Merge pull request #356 from Dmitry-Me/simplifyCodeWithTempVariables

Use temp variables to simplify code.