Full clean-up before implementing multithreaded support