refactored reviewed by @kannokanno.
* deleted commented out logic
* fixed typo
* fixed the problem generating auto complete config object each call