Helper functions for custom elements