Refactored nokogiri parser