Moved misc methods to util.js script