convert to smarty3