Cleaned up DOM traversing