modulize map drawing part