Add doc comment to extractPrimitives