Extracting version checking logic