Improved deprecation handling