fixup! preserve order of builtin phases
fixup! clean up and simplify the implementation