speed optimizations by moving layers to collections