I should move this out to it's own class. @paulcbetts will you be offended?