move a function to header