refactoring vote system