Refactoring and added some logging
Merge pull request #2 from imDeprecated/master

Refactoring and added some logging