Reducing cyclometic complexity of the main stub-registry findMatchFor function by splitting the various checks into separate sub-functions.