This is a nice generic way of dealing with this!