optim in layer rendering