key: added method to extract key and transform/hash it in one place