move code to .inl