move helper functions to ogvic.js