Cleaning templates and adding footer element support