Better way of detecting version