refactored voting, improved test coverage