Reduce cyclomatic complexity in some hotspots.