Modifying integrators using template to make them more general