Refactor output structures.