remove threading, simplify cache logic