Re-factoring the previous pach for printing optimization for issue #15