refactoring & fixed the problem slow down vim