Refine the giri flow graph