Merge pull request #2 from gagoar/master

Improvements and refactor