Updated the method to pass data into the template.