move function from header file to .c file