Does it make sense to move this if statement under the one above? This way the code is only run if the first condition is met.