update Template Loader with 'with' statment
Merge pull request #999 from mengzhuo/master

update Template Loader with 'with' statement