reduce visibility of encoding map and use entry set when iterating