Removed failureCount as a parameter, use internal state instead