implement with smarty lib