Maybe this would be cleaner as an anonymous function in the call to `getValue`?