improve performance of the 'special case' template substitutions