refactoring of voting methods in users controller and vote.js