Better way of handling key matching potentially