Refactor provisioning scripts