switch from map to struct