Merge pull request #5 from tim-bezhashvyly/master

Fix, refactor, test