refactor code to use module
Merge pull request #5 from kchien/refactor

refactor code to use module