refactored votes_controller