Extension: template factory fix