map gatherer prepare refactoring