add: Support user defined word dictionary, and some refactoring changes