cleaned functions to the head section