Refactored inspections to use state machine