Put some duplicated functions in Templates_common
Remove duplicate functions again