refactor list.rb a little bit