Optimize function to load custom CSS styles