Refactored to include a Map module