Tidy up response handling