Move checking of status to its own method.