fix bootstrap, and remove deadcode