support many classes, fix concurrency