Refactor bootstrap