optimized version for vim