Refactor AJAX voting