slight refactor to index.rb