added vim helper and abstracted logic