Move lines +282-284 within this ```if``` statement, where it's only relevant.