refactored tests to use each instead of some method