Major refactor, now single threaded