improved extractcontent.rb a bit