Improve readability and understanding of the state resolution algorithms.