Consolidate helper functions