Refactor voting module