externalizing variables and scope improvements
Merge pull request #78 from norbertpotocki/small-improvements

externalizing variables and scope improvements