before refactoring to map