change deprecated methods to new recommended methods.