move the modify trampoline code to build_trampoline method.