moved bootstrap code to top level