Refactor provision and prepare commands