More changes to make the template more flexible