Refactor to use minified js