improved index.rb