Avoid call to deprecated methods.