Improve incremental template to manage header and footer if there is a block