Merge pull request #6 from OpenifyIt/refactoring

refactoring + unit tests
Merge pull request #2 from powmedia/master

merge with powmedia