change scope of helper function to meet vim v7.4 requirements