Better use of template and clear on template helper