move some code to job module