reorganized the backend, new threading class.