Rewrote model loading