Refactoring version check.