Final version of template before refactoring.