Refactor spinner