tidy serializer by moving implementation to .ipp file.