Re-structure the functions in depth-first order
remove the dragon