Refactored bootstrap code; Added regex pattern matching to debug