refactoring and maps