Improve code coverage, reduce complexity