separating model matching into function for threading
prepareo multithread