move serializer initialization to initializer