Moved extension methods into util.js