improving performance of lehd_handler