add smarty and structure code