replace deprecated methods calls with new ones