refactoring how version is stored