Refactor shrink impl