refactor smarty module