Could you remove the duplicate `if` here?