I like the generality here, but we should put in another `#TODO FIXME` comment here to highlight the possible performance improvements.