Updating code to not use deprecated methods.