Migrated the code to SDK3.