Refactor shrink_count method