main: move printing of version into a function