Conditional use of deprecated methods