refactoring mapReact