Revert "Move compatibility hack to extension"

This reverts commit 7fe7fd511363755342bcefe91f5959790a7c98bc.
Check class exists