Good helper function! Let's put it in utils.js, I could see using this elsewhere.