Sort out success and failure.