extracted bootstrap code