pull version handling out into own function

no real reason, just tidying - will do --list the same way probably