Code cleanup
Merge pull request #394 from sheebans/master

Code cleanup
resolved conflicts