Revert "removed unnescessary structural typing hack"

This reverts commit 9167ff0fafd8543239b1d0ffd4e1435ccc1aa905.