What is the best way to avoid duplicating code?

Printable View