refactoring hash collector