Move formatting to common part