refactor votes class