some refactoring for windows gvim working