optimize the speed