Refactor boot script