Malphigian tubules are proto structure of nephron. How?

Malphigian tubules are present at the junction of midgut and hindgut of cockroach.
They help in removal of excretory products from haemolymph. In higher animals it resembles to nephron