replace if then with case statement, and tidy up variable naming to UPPERCASE, add default provider warning