refactor using #each
minor edit to rspec text