refactor into command and package
Merge pull request #30 from nf/master

refactor into command and package