minor speed opt
Merge branch 'devel_new_templates' of github.com:peruzzim/UserCode into devel_new_templates