refactor the implementation
Merge pull request #3 from laruence/master

merge with laruence