What is the best way to consolidate this code?

Printable View