Implementing smarty library