added a refactored contents.rb