How to get rid of deprecation warnings when providing backwards compatibility