some basic but major optimization of the new chatlog directive