rework so that res and client_res can coexist