better deprecation code