More cleaning of templates; replaces hardcoded urls