extract datapath according to output only