Improve time search logic.