replace deprecated methods with new API