simplify deprecation code (@dangra’s idea)