Refactor voting