concat and template cleanup