refactor print section