vote code refactoring