Updated to work with heat templates