refactoring tests and added an extension to enumerable module