moved map initial setup into separate function