refact: update the source code to avoid the deprecated method calls.