restructure voting part of codes and schema