cleanup print code