refactor voting to include validation