Improved aggregation of layers on server and client side