Refactor to use break control flow interrupt