Refactoring shell script for vimwiki update