added utility function to thread different secure header functions