extracted best match finding to method
Moved find best match method