Move condition to method for improved readability.