Add some word generation optimization