refactored Map controller