Move the current version detection method to its own subroutine