Tidy up and add minified version