Factoring with the rainbow method