improved threading and docs