Refactor final output