I don't like this function, I'd rather have the makeData stuff in the onVote method. You've 3 null checks in here, 2 of which can't ever be null.