refactor: extract create_compound_key/destroy_compound_key