the upgraded version of template solution