try to access the dom the least as possible

Because the dom is so slow :(