Move the "smart_match" method to the "misc" module