Implement the result restructuring