refactoring votes controller