Code refactoring and a new map