Restructuring for client-side rendering