Refactor shrink_count