clone from 2TE-Bootstrap