Improve support for different versions