improving mapping of thread