Use reflection for better cross-version compatibility