move zero_counter into util