How can I make this code concise?

Printable View