Centralized BadStatusLine handling, some cleanup and commenting