Moved loading code