VIVO-533 Simplify the code in the template loader.