Optimize and minify code