Merge pull request #16 from zelgerj/master

refactoring due to hook feature
fixed tests