Carlos refactor of template code to display data