move some var to ctx