Simplified IsJust function