Consolidate version checking into one single function