voting refactoring