Rewrite with variadic templates