Master template cleanup