Optimize version handling