small refactorings and implement enhancement #4
Merge pull request #9 from melwinm/master

small refactorings and implement enhancement #8