Looking for a better way to write this code please

Printable View