Refactor: use the new Map class instead