Refactor version comparing logic
Merge pull request #2 from mizoR

refactor version comparing.