Reduce complexity of check function.