optimize: use ArrayList instead of Map