Refactored to use Nokogiri and be much cleaner