moved all header functions to controller