minor tidy and add generation of minified code