Common helper functions