redesign to use the new apr_hash_get_or_set function