nearly finished nokogiri refactoring