working on template and element processing