Updated model discover code