Optimize convertVersion method