Fixes the unused variable warning

And also makes the code more readable
according to Harvey's liking.