Helper functions extracted into a separate header