Check the SDK version for the deprecated method
minor refactoring
minor refactoring