refactored major version extraction