functions commonly used in my DOM-oriented modules