Optimized the page loading by doing heavy lifting with modal opens.