A new proof of a theorem of Jayne and Rogers