refractored bootstrap