Moved all non-inline functions from header to source in model