Refactored bootstrap script