Small refactoring: moved Nokogiri manipulations into a separate file