Make use of strongly typed variables and stop using deprecated properties.