Moving some function definitions from .h to .cc