Voting functionality and code cleanup