refactor vote