Proposed refactorings for shrinking algorithm

Extraction of some duplication to pursue readability.