A child presented with intermittent episodes of left sided flank pain. Ultrasonography reveals a large hydronephrosis with dilated renal pelvis and cortical thinning with a normal ureter. Kidney differential function was observed to be 19 percent. Which of the following is the best management?