Extract code to get current version