code improvement for puppet version check