Split out processing and formatting