refactored upvoteHandler