Remove use of exceptions for flow control