simplify response code checking logic