Moved integrator to a separate class