simplify version check logic