Merge pull request #30 from fengjingchao/inst

test and refactor