Refactor to use Nokogiri.