Optimized some code.

Noticed a very long bit of code that could be 3 lines