Is there really no way to code this easier?

Is there really no way to code this easier?:

#arduino