add options to use hash instead of map