ctx = clientTokenContextManager.getClientTokenContext(mc);
if (ctx != null) {
ClientAccessToken newAt = refreshAccessTokenIfExpired(ctx.getToken());
if (newAt != null) {
clientTokenContextManager.removeClientTokenContext(mc, ctx);
<BUG>ClientTokenContext newCtx = initializeClientTokenContext(newAt, ctx.getState());
</BUG>
clientTokenContextManager.setClientTokenContext(mc, newCtx);
ctx = newCtx;
}

ctx = clientTokenContextManager.getClientTokenContext(mc);
if (ctx != null) {
ClientAccessToken newAt = refreshAccessTokenIfExpired(ctx.getToken());
if (newAt != null) {
clientTokenContextManager.removeClientTokenContext(mc, ctx);
ClientTokenContext newCtx = initializeClientTokenContext(rc, newAt, ctx.getState());
clientTokenContextManager.setClientTokenContext(mc, newCtx);
ctx = newCtx;
