Refactored votes controller