Refactoring the code, extract model and util packages.
Add comment for the test code.