Moved version logic into it's own function