refactoring loadljob.py