Refactoring: Use method to express condition check