Refactored using Element/VoidElement base classes.