Optimized the JavaScript Module pattern