refactor ExpandVersionVariable to separate GetLatestVersion