Remove redundant class and update thread logic.