refactor some templates and cleanup some code
Merge branch 'hotfix/1.3.0'