some map type detection logic