Extracted templating functions from the bar level into a generic level powered by templates.