Template localization