In the function
the dataset is queried twice:
Maybe, pass the dataset created in lines 30 to 33 to GeneralTrait to avoid re-querying the data.
Pr that fixes the issue: