drastically simplified and added concurrency