Re-worked response parsing to make it less fragile