my ideal solution but p'bly not most idiomatic