refactor ballot