Refactored some of the voting code.