Adds class preordering. Fixes concurrency issues