factor out more methods, particularly in DOM culling