refine the protocol io reader writer arch.