Move function definition from header to cpp.