if all element types have this check, why not move it to `Element` class where you can use `getContent()` for any element types?