refactoring handling of version