[DEV] Refactor with only one thread