Move circuit breaker into library