Lots of changes for cleaner code
Merge pull request #1 from odininon/master

Cleanup