Selecting a closure based on results