each refactored