replace this_proc with this_ctx. move more things out of proc that don't belong.