Use mixin instead of whole code
Merge pull request #11662 from ZDroid/deprecation-fix

Use mixin instead of whole code