Improve provisioning logic