Moved version computation into a utility method.