Refactor duplicate code
Handle unknown versions