move function definitions from header to source file