Functional refactoring of results