code cleanup, fix unit tests
Merge pull request #8 from metridoc/clean-up

code cleanup, fix unit tests