Remove legacy codes before "beforecustomization" and "aftercustomization" are landed