Overhaul of bootstrap script. Non-tested