Miles is refactoring the code, so most of the code you see here comes from somewhere else. I agree that the code here could be better, but I would say do make the improvements after the refactoring and the tests are in place.