replaced server side generation with client side logic