I was casting way too many variables. This is better.