rewrite using Smarty3.1.18