switched from regex to map