optimised pizza main.js file