Enhancement: implement this using a map {}