maps refactor