Improve version gathering