There's some (almost) identical code in these checks, this could be refactored in such a way that both make use of a single function.
There's some (almost) identical code in these checks, this could be refactored in such a way that both make use of a single function.