Refactor template
Add template test
Merge pull request #118 from miraclesu/test

Refactor template visit & Add template test