DOM reading optimization