Refactor function getting the name and os version.