refactor for threading

why? how do you clear history now?