Outsourced the version check to a proper function.