An accident investigation is a critical step to: