Fixed Install-WindowsFeatures and refactored code