Refactor VersionParser, make some improvements