change jobwrap to simplify the logic