Improved performance by parsing HTML once