remove unused variable QueryString

move toUpperCase method outside foreach