Improved the version detection code by reducing grep|awk pipeline to just awk