Improved excerpt code